Area Exporting
The PDF of this version may be downloaded here: http://www.witchermod.com/djinni/exporter_translation.doc You can find a fully working example area here: http://www.moddb.com/games/the-witcher/downloads/example-area Basic elements of a scene prepared for exporting Scene made up of visible geometric elements, walkmesh, AuraBase Lights, doors and emitters. AuraBase Only elements linked to a special AuraBase object and certain walkmesh elements will be exported (components present in the list of the Walkmesh Mod modificator). The AuraBase object is located in the 'helpers' category. The most important parameter in Aura Base is the 24 hour Animation (Anim24h) which should be present on the Animations list with a chosen range of animation frame rateStart:0 End:24. The Detail map contains the name of the texture map detail for the whole location. Location Dummy The scene also contains in its hierarchy an additional object called the Dummy, to which the animated elements of the location are linked (e.g. AuroraLight Lights with animated parameters for the changing day/night cycle). The object has to be specially named. Its name is identical to the Aura Base name but lengthened with an additional letter ‘a’ at the end. Object “North” The special Dummy object called „north” linked to the location Dummy is used to mark the direction of the North needed to calibrate the minimap in the game. The Y axis in the local design of the coordinate of the object “North” points to where the North is. Additionally the object placeable skybox is automatically rotated in the direction of the Y axis of the object “North”. Visible Geometry It may be any object Editable Mesh. The AuraPoly contains all additional parameters such as the Lightmap settings. The parameters for lightmap are described in a different document. The other basic parameters for solid geometric objects in a location: Doors A door May be any box shaped object. The important task is the proper adjustment of the rotation axis and so the pivot point and his orientation in the local coordinate range. The simplest rule is adjusting the pivot point axis so that the X coordinate is directed, like on the image below, to the outside yet parallel to the plane of the door. Such a position of the axis is needed for the correct orientation in terms of the animations of the opening door, which is saved in the external file door_x01.mdl. It is a universal file used by most doors. An object which is meant to be a door leads the Door modification. During the adding of the Door modification a unique ID number is generated. You have to target the file with the animation (door_x01.mdl) and Template (.utd) needed for the Djinni editor. The required Template is acquirable through the copying of one of the already existing ones and giving it a new name. If In the scene doors are present then during the export a new folder will be created nameoflocation_doors which will contain the appropriate files. Doors In the Blendbox system Every door might force the fading of a desired object (fragment of the geometry around the door) and eliminating collisions for the camera in order to make passing through e.g. doorways much simpler. For this we need an additional object Box with a special name “Blendbox”. It defines through its cube the extent of the changes. It must be linked to the door. Its function is apparent through the fading (after opening the door) of objects with which is has common matter (crosses over with). The object which is to be influenced by the Blendbox must have this tagged in its AuraPoly modification. Also the walkmesh collision triangles, which cut through the Blendbox, change their ID (21) to non-collision after the door is opened. Dynamic Lighting These are lights used to illuminate the geometry, which does not have an assigned lightmap and so a character, Placeable objects, generic locations without lightmap and also illumination through dynamic methods some objects with a lightmap. They may be exported together with the location. Most often these are animated light with a 24h cycle. Multiplier and Color are the animated parameters. Warning: all the exported parameters of these lights are set on the AuroraLight Parameters. Materials All materials are assigned to the materials editor. #Standard Materials The Basic type is a Standard Material with a Diffuse map. The assigned texture (in the .tga format) may have a transparency alpha canal and may (but does not have to) be assigned also as an Opacity map in the Standard Material. In the case of using a Standard material with a transparency map, the settings of the Render list in the AuraPoly modification influence the method of its ‘presentation’ (Opaque, Transparent). Commonly the multimaterial of the Multi/Sub-Object type is used. Warning: from the Standard material the Diffuse color is exported which causes the appropriate tint. In order to obtain the natural shade of the texture you should change the Diffuse color to white. : 2. Aurora Material and TestMat Material types Aurora Material and TestMat Material give the possibility of assigning shaders saved in external test files. Shaders are /mfx files and they are located in D:\Witcher\Stable\scripts Aurora Material and Test Mat give similar possibilities in assigning shaders; they differ only in the method of saving and editing the material’s parameters. Aurora Material uses an external text file .mat In which the correct configuration parameters are saved. They are located in D:\Witcher\Data\Materials\Materials This gives the possibility of editing the material in the future without further need of exporting the scene. It has to be noted how many objects have reflection turned on. This option is solely for the material not the object, and so this option must be used very carefully. It is recommended that only one object per scene has reflections. It has to be a complete flat object (making one plane). In other words in a scene there may be only one plane of reflection, it may be also achieved from a number of objects but they must lie on the same plane (otherwise the reflections will be calculated the number of times equal to the numbers of planes which will greatly reduce efficiency). TestMat does not use an external configuration file. All the Material parameters for the chosen shader can be adjusted directly in the material editor and they are saved in the .max file together with the scene. Shaders are .mfx files and are located in D:\Witcher\Stable\scripts Texture Paint Texture Paint is used to paint textures onto net peaks. The object to be painted must be an Editable Mesh and hale the assigned Texture Pain modification. Then he must be assigned a Multi/Sub Object material with assigned textured. These textures have a specular mass on the alpha canal and may be recognized through their name prefix: trn_ In order to make the Texture Paint material visible In the 3dsMax preview you have to turn on the plugin material option under the name of Texture Paint Shader in one of the Multi/Sub Object material’s undermaterials. In the Texture Paint Modification a list of textures/materials appears with which you may paint upon completing the operation of giving the Material Multi/Sub Object. Warning: you do not have to Change the number of peaks to objects with the Texture Paint modification, because this will destroy the information of painting on it. In order to modify such an object you have to perform the collapse Texture Paint, and then the information on the painting will be saved on the Editable Mesh level. In such a case only a correction (painting) of only that area will be needed in which the number of peaks has been changed. It is possible to modify this object through the help of Editable Poly but then the Texture Paint Shader cannot be shown- you can however temporarily for example change the material to a different one. Grass With the Texture Paint Modificator is also combined the function of sowing Grass. The idea of sowing grass is based on assigning certain types of grass to terrain materials painted with the help of Texture Paint. The available sets may be found in the Grass modificator assigned to Aura Base scenes. This modificator allows the assigning of grass sets to Texture Paint materials. This is done by double clicking on the Grass Sets list of the chosen grass set. The buttons below this list are similar to those in the Texture Paint modificator. In each use of Texture Paint in this scene the exactly same set of grass will be assigned. The distribution of the grass is kept in a special texture .vgm It is generated automatically during creating an UVW for grasses. To create such a distribution you hale to go to the Walkmesh Mod modificator on the Aura Base object of the scene. Mark the option “Has Grass” on the component list for the given object. This operation adds a BakeWeightMap modificator to AuraBase of the scene and places the given object on the Target Objects list, so the grass will be sowed on this. BakeWeightMap modificator contains also the Source Objects list, to which we assign objects painted with Texture Paint with assigned grass slots. On the Source Objects list, you can place the same object as on the Target Objects list, which causes sowing grass on the object itself. It results therefore that you can sow grass in two ways: * sowing on any non-renderable Walkmesh plane - an image of the grass distribution is projected from an object painted with Texture Paint (e.g. terrain object) * sowing directly on a location geometry (e.g. the terrain) – an image of the grass distribution is projected from the same object (painted with Texture Paint) Note 1: you cannot edit the Target Objects list manually. The required object will be added there automatically by the means of Walkmesh Mod. Note 2: because of a known bug in the order of assigning objects to the Source Objects list, it is possible that you will not be able to assign to it an object which has previously found itself on the Target Objects list. If this happens, we recommend a workaround solution: * temporary unchecking the Has Grass field for the object in Walkmesh Mod (which removes it from the Target Objects list) * adding the object to the Source Objects list (which is now possible) * ticking the Has Grass field again in the Walkmesh Mod If unchecking the Has Grass field in Walkmesh Mod removes BakeWeightMap modifier, to avoid this you should temporarily add an additional object with Has Grass ticked before After having placed all the objects on the appropriate lists you should start Render, which will assign the BWM UVW Map modificator to all the objects with „Has Grass”. It contains all the data on the UVW distribution of grasses on channel 6. The texture will be rendered in a resolution controlled by Grid Size parameter, under the name given in Output File field. Walkmesh Walkmesh consists of collision and navigation geometry. Geometry Collision Every object can be a collision Walkmesh. However, for optimization, you often use simplified geometry. For a given object to become a walkmesh, you have to place it in a Walkmesh Mod modificator, which will be added to AuraBase of the scene. Walkmesh Mod contains a Components list, to which all objects that are meant to be walkmeshes are added. Thus, it is possible that it may contain both special collision objects (invisible) as well as location elements (visible). Special geometry should be lined to the AuraBase of the scene. Material ID for each of the objects walls is an important parameter for the collision geometry. Namely, the Id defines the sort of collision and the sounds connected to it, including the footstep sounds on different types of terrain. If we use “IDs from texture” parameter, the properties of each of the IDs will depend on the name of the catalogue with the given texture. A following catalogue structure is used: If you don’t use the IDs from texture parameter, properties from an external file will be used: D:\Witcher\Data\2DA\engine\surfacemat.2da Note: IDs in 3dsMax are numbered from 0. Thus, you need to add +1 to figures from surfacemat.2da for and ID in 3dsMAx. E.g. to receive properties of ID 20 CameraCollision, you need to use ID=21 in 3dsMax. For better orientation in 3dsMax you can use helper materials. They are not exported however. An excerpt from surfacemat.2da file: Most important qualities of ID: *WalkCheck: To these walls the player will be connected (you will be able to move on these walls) *Walk : unused *LightCheck: these walls will be used for lighting objects with the walkmesh lightmap *LineOfSight: these walls prevent characters from seeing each other *CameraColl: camera has collisions with these walls *PhysicsColl: these walls have collisions with other physics (except for camera) Navigation Geometry It determines the area where characters walk and is used for pathfinding. It is not used directly for walking, it only marks the frames of walkable areas on collision geometry. The X and Y axis are crucial to its build. This means that it is not necessary precise fitting the height to the collision geometry (the tolerance in Z axis is +/- 0.5 m). It cannot however draw an area beyond the reach of the collision geometry (the character wouldn’t have what to walk on) . It also cannot contain some triangles "above" others or too steep planes. Minimum width of a passage is circa 1.5 m. To create a navigation geometry, you have to link it to Aura Base of the scene and assign a RoomPaint modificator to it. The modifier will identify this object as a navigation geometry. The basic function of the RoomPaint modifier is to map out rooms to outline the optimum walk paths. To view rooms, you have to turn RoomPaintShader on in the material of the object (similarly to Texture Paint materials). You can paint rooms on those walls of the object, whose ID is marked as walkable in the surfacemat.2da file. Using Roompaint modifier assigns special IDs to the object. You shouldn’t change these IDs manually. Rooms cannot repeat, each has a unique ID. Three RoomPaint functions are used to pain them: Paint, Floodfill, Find Free. If changes are needed to the geometry of an already painted object, you have to delete the RoomPaint modifier, turn off RoomPaint Shader (or temporarily change the material to a standard one), edit the geometry net, and then restore the modifier and material. Rules of using room division The right division has key influence on the efficiency and quality of seeking out paths. The basic properties of division * Two rooms May be connected with ONLY ONE Edge. *A room is a cohesive area. It does not have to be convex, it might also contain holes. It is worthwhile to create convex rooms. There is no limit for it for the engine, but it is useful to stick to this in most cases, but without going over the top. Small ‘unequal-nesses’ which will destroy a perfect convex are not a problem. *Tight passages are to be marked with small rooms. *It is very important that there is a passage between two rooms that are connected. *There are no limitations as to the size, although it is a good idea to keep to certain standard (characteristic for the actual area). Open spaces may be filled up with bigger rooms; enclosed spaces should have smaller ones. Usually- a bigger room means a quicker search of RGS and a bigger simplicity of the map. A smaller Room- much quicker in checking that a path “does not exist”. * You should know approximately know how will the placeables be placed on the map. Avoid dividing rooms into those where placeables are on the edges of rooms. * With a drastically high number of placeables you should use bigger rooms (for example similar to Real rooms). * It is a good idea to mark areas as different rooms when they are on different heights. More about this later on. * Be careful with creating small rooms. Be sure that the Witcher will be able to find his way inside them. TRIKI: #Slopes. If we want the Witcher to look for passage like stairs- and take into consideration the slope already in the phase of searching around the rooms- set the edge of the room exactly on the edge of the slope. #Efficiency. On the lowest level of searching for paths, checking paths between rooms, take into consideration points lying exactly in the middle of the two connecting edges. We can achieve a high increase in efficiency of the path seeking system if we will use the correct methods of room division. Where it is possible let us try to have each room to make a direct passage between all of the mid points of its edge with other rooms (that is why it is good to create convex rooms). Direct passages are those that do not require the activation of the path seeking system on the lowest level, what means that the player may be passed through without any collision in a straight line between these points. Category:Areas